package rpc.server.impl;

import org.apache.hadoop.ipc.ProtocolSignature;
import rpc.server.MyInterface;

import java.io.IOException;

/**
 * MyInterfaceImpl
 *
 * @author zhangyimin
 * @version 1.0
 * @date 2018-07-27 下午3:15
 */
public class MyInterfaceImpl implements MyInterface {

    public String sayHello(String name) {
        System.out.println("================  调用到服务端   =================");
        return "Hello !" + name;
    }

    public long getProtocolVersion(String s, long l) throws IOException {
        return MyInterface.versionID;
    }

    public ProtocolSignature getProtocolSignature(String s, long l, int i) throws IOException {
        return new ProtocolSignature(MyInterface.versionID, null);
    }
}
